const setTime = (obj) => {
    const d = new Date(obj)
    const p = (s) => {
        return s < 10 ? '0' + s : s
    }
    const time = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + p(d.getHours()) + ':' + p(d.getMinutes()) + ':' + p(d.getSeconds())

    return time
}
const parserDate = (date) => {
    var t = Date.parse(date)
    if (!isNaN(t)) {
        return new Date(Date.parse(date.replace(/-/g, '/')))
    }
}

export { setTime, parserDate }